home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 92 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.7 KB

  1. Path: engnews2.Eng.Sun.COM!lupa!corbett
  2. From: corbett@lupa.eng.sun.com (Robert Corbett)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Meaning of __STDC__?
  5. Date: 13 Jan 1996 06:08:59 GMT
  6. Organization: Sun Microsystems Computer Corporation
  7. Message-ID: <4d7i9r$euv@engnews2.Eng.Sun.COM>
  8. References: <4d6673$8to@mailgate.bridgewater.ne.hcc.com>
  9. NNTP-Posting-Host: lupa.eng.sun.com
  10. Cc: 
  11.  
  12. In article <4d6673$8to@mailgate.bridgewater.ne.hcc.com>,
  13. John W Kennedy <kennedy1@bwmail1.hcc.com> wrote:
  14. >Is there an official statement as to what __STDC__ means?  Does it mean "This
  15. >compiler (in its current operating mode) fully supports ANSI Standard C," or
  16. >does it mean "This compiler (in its current operating mode) disallows all
  17. >extensions to ANSI Standard C."?  In my opinion, common practice and the
  18. >Rationale both support the former, rather than the latter, but is
  19. >there an official ruling?
  20.  
  21. __STDC__ is almost meaningless.  For a standard C compiler, it is a synonym
  22. for 1.  A compiler that is not standard conformant is free to define __STDC__
  23. to be 1, since the C standard affects only conformant compilers.
  24.  
  25. The setting of __STDC__ does not prohibit extensions.  The C standard allows
  26. arbitrary extensions provided the compiler issues at least one diagnostic
  27. message for each program that violates a syntax rule or constraint.
  28.  
  29. The Solaris 2.4 and 2.5 header files use a magic symbol to allow access
  30. to parts of the headers that otherwise would not be accessible in strict
  31. compliant mode.  If the symbol __EXTENSIONS__ is #defined before #including
  32. a header the entire header is read.  No strictly conforming program is
  33. allowed to #define __EXTENSIONS__, but the prohibition is not a constraint.
  34. Therefore, no error message need be issued.
  35.  
  36.                     Sincerely,
  37.                     Robert Corbett
  38.